import React from 'react'
import ReactDOM from 'react-dom/client'

const root = ReactDOM.createRoot(document.getElementById('root'))

// jsx使用js表达式
const name = '黑马'
const age = 18
const friends = ['张三', '丽思']
const sayHi = () => {
  return '你好'
}
const span1 = <span>我是一个span</span>
const elem = (
  <>
    <h2>{name}</h2>
    <p>是否允许上网：{age >= 18 ? '是' : '否'}</p>
    <p>{friends[1]}</p>
    <p>{sayHi()}</p>
    <p>{sayHi + ''}</p>
    <div>{span1}</div>
    {/* <div>我是一个注释</div> */}
  </>
)
root.render(<>{elem}</>)
